<?php
	class Register extends Controller{
		
			function Register(){
					parent::Controller();
					$this->load->library('validation');
					$this->load->helper('url');
					//$this->load->view('user_register');
				}
			function index(){
									$this->load->view('user_register');

				}
			function  reg(){
					$rules['username'] = "required";
					$rules['password'] = "required|md5";
					$rules['email'] = "required|valid_email";
					$rules['truename']="required";
					$reg_time=time()+28800;
					//echo $reg_time;
					//print_r($_POST);
					$_POST['reg_time']=$reg_time;
					//print_r($_POST);exit;
					echo  date('Y-m-d H:i:s',$reg_time);
					$this->validation->set_rules($rules);
					if($this->validation->run() == FALSE){
							$this->load->view('user_register');
						
						}
					else{
						$this->load->model('regmodel');
						$this->regmodel->reg($_POST);
						
						}
					
				}
			
		
		
		}
		
?>